﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceImplementation.Translator.DataContractToBusinessEntity
{
    public class RelacionamentoBroker
    {
        public BusinessEntity.RelacionamentoBroker ToRelacionamentoBroker(DataContract.Request.RelacionamentoBrokerRequest from)
        {
            BusinessEntity.RelacionamentoBroker to = null;

            if (from != null)
            {
                to = new BusinessEntity.RelacionamentoBroker();

                to.ApelidoBrokerIntermediario = from.ApelidoBrokerIntermediario;
                to.ApelidoBrokerPrincipal = from.ApelidoBrokerPrincipal;
                to.CodigoBrokerCliente = from.CodigoBrokerCliente;
                to.CodigoBrokerIntermediario = from.CodigoBrokerIntermediario;
                to.CodigoBrokerPrincipal = from.CodigoBrokerPrincipal;
            }

            return to;
        }

        public BusinessEntity.Parameter.FiltroRelacionamentoBrokerChave ToFiltroRelacionamentoBrokerChave(DataContract.Request.FiltroRelacionamentoBrokerChaveRequest from)
        {
            BusinessEntity.Parameter.FiltroRelacionamentoBrokerChave to = null;

            if (from != null)
            {
                to = new BusinessEntity.Parameter.FiltroRelacionamentoBrokerChave();

                to.CodigoBrokerIntermediario = from.CodigoBrokerIntermediario;
                to.CodigoBrokerPrincipal = from.CodigoBrokerPrincipal;
            }

            return to;
        }

        public BusinessEntity.Parameter.FiltroRelacionamentoBroker ToFiltroRelacionamentoBroker(DataContract.Request.FiltroRelacionamentoBrokerRequest from)
        {
            BusinessEntity.Parameter.FiltroRelacionamentoBroker to = null;

            if (from != null)
            {
                to = new BusinessEntity.Parameter.FiltroRelacionamentoBroker();

                to.CodigoBrokerCliente = from.CodigoBrokerCliente;
                to.CodigoBrokerIntermediario = from.CodigoBrokerIntermediario;
                to.CodigoBrokerPrincipal = from.CodigoBrokerPrincipal;
            }

            return to;
        }
    }
}
